home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 5.6 KB | 184 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: TblFrame.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TBLFRAME_H
- #define TBLFRAME_H
-
- // ----- TablePart Includes -----
-
- #ifndef TBLPART_H
- #include "TblPart.h"
- #endif
-
- // ----- ODF Includes -----
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- //========================================================================================
- // Forward declarations
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR FW_CGraphicContext;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- class FW_CLASS_ATTR CTablePart;
- class FW_CLASS_ATTR CTableSelection;
- class FW_CLASS_ATTR CTableProxy;
-
- //========================================================================================
- // class CTableFrame
- //========================================================================================
-
- class FW_CLASS_ATTR CTableFrame : public FW_CEmbeddingFrame
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CTableFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CTablePart* tablePart);
- virtual ~ CTableFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Getters/Setters -----
- CTablePart* GetPart() const;
- CTableSelection* GetSelection(Environment* ev) const;
- ETableLoc GetDragLocation() const;
- CCell GetDragCell() const;
- CCell GetDragSourceCell() const;
-
- // ----- Focus change -----
- virtual void FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);
-
- // ----- Embedding -----
- virtual void EmbedSingleFrame(Environment* ev,
- ODPart* odEmbeddedPart,
- ODFrame* odEmbeddedFrame,
- ODShape* frameShape);
-
- virtual ODFacet* CreateEmbeddedFacet(Environment* ev,
- ODFacet* embeddingFacet,
- FW_MProxy* proxy,
- ODFrame* embeddedFrame,
- ODShape* proposedClipShape);
- // ----- Rendering -----
- virtual void Draw(Environment* ev,
- ODFacet* odFacet,
- ODShape* invalidShape);
-
- // ----- Menus -----
- virtual FW_Boolean DoAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
- virtual FW_Boolean DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
-
- // ----- Events -----
- virtual FW_Boolean DoCharKey(Environment* ev, const FW_CCharKeyEvent& theCharKeyEvent);
- virtual FW_Boolean DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
- virtual FW_Boolean DoMouseDownInEmbeddedFrameBorder(Environment* ev, const FW_CBorderMouseEvent& theBorderMouseEvent);
-
- // ----- Adjust Cursor -----
- virtual FW_Boolean AdjustCursor(Environment* ev, ODFacet* odFacet, const FW_CPoint& where);
-
- // ----- Geometry -----
- virtual void FrameShapeChanged(Environment* ev);
-
- // ----- Drag And Drop -----
- virtual FW_CDropTracker* NewDropTracker(Environment *ev, FW_CView* view, ODFacet* facet);
-
- virtual FW_CDragCommand* NewDragCommand(Environment *ev, FW_CFrame* theFrame);
- virtual FW_CDropCommand* NewDropCommand(Environment *ev,
- FW_CFrame* frame,
- ODDragItemIterator* dropInfo,
- ODFacet* odFacet,
- const FW_CPoint& dropPoint);
-
- virtual FW_CEditCommand* NewEditCommand(Environment* ev, ODCommandID commandID);
-
- virtual FW_Boolean Drag(Environment* ev, const FW_CMouseEvent& event);
-
- // ----- Linking -----
- virtual void FacetAdded(Environment* ev, ODFacet* facet);
- virtual void ShowPartInfo(Environment* ev);
- virtual FW_Boolean RevealFrame(Environment *ev,
- ODFrame* embeddedFrame,
- ODShape* revealShape);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void DrawGrid(Environment* ev, FW_CGraphicContext& gc, FW_Boolean gray);
- void HideShowGrid(Environment* ev);
-
- FW_Boolean IsGridShown(Environment* ev) const
- {return fGridShown;}
-
- void GetRect(Environment* ev, FW_CRect& rect) const;
-
- void DrawSelectBorder(Environment* ev, FW_CFacetContext& fc,
- const CCell& cell);
-
- void MoveProxy(Environment* ev, CTableProxy* proxy, const CCell& destCell);
-
- // ----- Mouse down response -----
- FW_Boolean Resize(Environment* ev,
- const FW_CMouseEvent& theMouseEvent,
- const CCell& cell,
- ETableLoc tl);
-
- void SelectCell(Environment* ev, const CCell& cell, FW_Boolean drawNow);
-
- // ----- Linking -----
- void DrawLinkBorder(Environment* ev,
- const CCell& cell,
- FW_CFacetContext& fc,
- FW_Boolean isSourceLink);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- // ----- Part back-pointer -----
- CTablePart* fTablePart;
-
- // ----- Drag & drop state variables -----
- CCell fDraggedCell;
-
- FW_Boolean fGridShown;
-
- FW_CRectShape fSelectFrame;
- };
-
-
- //----------------------------------------------------------------------------------------
- // CTableFrame::GetPart
- //----------------------------------------------------------------------------------------
- inline CTablePart* CTableFrame::GetPart() const
- {
- return fTablePart;
- }
-
- #endif
-